package com.ibeeking.found.common.enums.logistics;

public enum DeliveryWaysEnum {


    LOGISTICS_EXPRESS(" 快递发货", 1),
    LOGISTICS_SAME_CITY("同城配送", 2),
    LOGISTICS_PICKUP("到店自提", 3),
    LOGISTICS_NO_NEED(" 无须物流", 4),
    ;
    private String desc;
    private Integer code;

    DeliveryWaysEnum(String desc, int code) {
        this.code = code;
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }

    public Integer getCode() {
        return code;
    }

    public static String getDescByCode(Integer code) {
        for (DeliveryWaysEnum enumObj : values()) {
            if (enumObj.getCode().equals(code)) {
                return enumObj.getDesc();
            }
        }
        return null;
    }
}
